package com.example.onion.hxchat.room.dao;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.example.onion.hxchat.room.entity.Apply;
import com.example.onion.hxchat.room.entity.TeamNotification;

import java.util.List;

/**
 * 队伍通知信息dao
 * @author:onion
 */
@Dao
public interface TeamNotificationDao {
    @Insert
    void insertTeamNotification(TeamNotification... teamNotifications);

    @Delete
    void deleteTeamNotification(TeamNotification... teamNotifications);

    @Update
    void updateTeamNotification(TeamNotification teamNotifications);

    @Query("SELECT * FROM TeamNotification WHERE receivedUserId= :id")
    /**
     * 获得当前用户id收到的队伍相关的通知
     */
    LiveData<List<TeamNotification>> getTeamNotificationCur(String id);

    @Query("SELECT * FROM TeamNotification")
    /**
     * 所有
     */
    LiveData<List<TeamNotification>> getAll();





}
